<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'index.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

</head>

<body>
	<div
		style="margin:auto;width:900px; border: #000000 solid 1px;padding:20px;">
		当前用户为：${current_user }
		<hr>
		<c:forEach var="user" items="${users}">
			<ul>
				<span>用户${user.username} 的权限如下</span>
				<c:forEach var="role" items="${user.roles}">
					<li>${role.authority}</li>				
				</c:forEach>
			</ul>
		</c:forEach>
		<hr>
		所用具有 ROLE_ADMIN 权限的可以访问如 /admin/* 的页面<br/>
		<a href="<%=basePath%>admin/home">点击测试</a><br/><br/>
		
		所用具有 ROLE_TEACHER 权限的可以访问如 /teacher/* 的页面<br/>
		
		<a href="<%=basePath%>teacher/home">点击测试</a><br/><br/>
		所用具有 ROLE_STUDENT 权限的可以访问如 /student/* 的页面<br/>
		
		<a href="<%=basePath%>student/home">点击测试</a><br/><br/>
	</div>
</body>
</html>
